This week the exercise was about designing and interface and application for the Input or Output device
Video
For this assignment I wanted to visualize the rotation of the servo motor. I used my Fabduino Leonardo that I built for controlling the output device which I am going to use in my final project.
Firsly you have to download the Processing from the webpage Processing.org. After that I was looking for some samples related with this rotation that I wanted to visualize. As i don't have much experience with processing i did something simple. I did a square in processing, rotating according to the rotation angle of a servo motor that i am controling through my arduino leonardo. The first step for programming the interface, was to use an Arduino code in my board that would send information to Processing.The degree (angle) location of the servo motor are the data that fabduino send to the personalcomputer and prossessing reads through the serial port. The square is rotating according to these values converted from degrees to radians (divided by 180).To see the interface working see the video above.
TIPS:
/At the begining I had set as the rotation angle on the processing the values that were sending to the computer throught serial comunication, but the rotation movement of the square was different from the real rotation of the servo. The square was moving faster than the servo. Then I realized that i had to convert the degrees to radians (divided by 180)
Files: